const app = new Vue({
	el : "form",
	data : {
		account : null,
		password : null
	},
	methods : {
		login : function() {
			axios.post("/session",{
				account:this.account,
				password:this.password
			}).then(function(resp) {
				if (resp.code === "ok") {
					let userObj = resp.data;
					let userObiString = JSON.stringify(userObj);
					window.sessionStorage.setItem("userObj", userObiString);
					window.sessionStorage.setItem("id", userObj.id);
					toast("登录成功！")
						location.href = "/index.html";
				} else {
					toast(resp.message);
					shakeIt("form");
				}
			})
		}

	}
})